package com.aerfazhe.order.config;

import feign.Logger;
import feign.Request;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;


/**
 * @Author：wk
 * @Create：2022/4/10/19:59
 * @Description：Feign配置类
 * @Version：1.0
 */
@Configuration
public class FeignConfig {

    /**
     * 日志配置
     * @return
     */
    @Bean
    public Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }

    /**
     * 全局配置
     * 连接超时时长和参数读取超时时长
     */
    @Bean
    public Request.Options options() {
        return new Request.Options(5L, TimeUnit.SECONDS,10L, TimeUnit.SECONDS,true);
    }



}
